package main.java.design.interpreter;

/**
 * <p>
 *     也是抽象表达式的子类，用来实现文法中与非终结符相关的操作，文法中的每条规则都对应于一个非终结符表达式。
 * </p>
 *
 * @author : wangdejian
 * @version 1.0
 * @date : 2020/6/26 15:40
 */
public class NumberInterpreter implements Interpreter {

    private int number;

    public NumberInterpreter(int number) {
        this.number = number;
    }

    public NumberInterpreter(String number) {
        this.number = Integer.parseInt(number);
    }


    @Override
    public int interpret() {
        return number;
    }
}
